#ifndef LAURIN_IP_NETWORK_H_
#define LAURIN_IP_NETWORK_H_

#include "laurin-ip-range.h"
#include "laurin-ip-network-client.h"
#include <list>

class LaurinIPNetwork
{

	public:

		LaurinIPNetwork(u_int32_t localAddress, u_int32_t subnetMask);
		virtual ~LaurinIPNetwork();

		/**
		 * Return a copy of the ip range of the network.
		 * After the use, it must be deleted.
		 */
		LaurinIPRange* getIPRange() const;
		u_int32_t getLocalAddress() const;
		u_int32_t getSubnetMask() const;


		void removeAll();
		LaurinIPNetworkClient* isClientPresent(u_int32_t ip);
		bool addClient(u_int32_t ip, u_int8_t* mac, bool check = true);
		bool addClient(const LaurinIPNetworkClient& client, bool check = true);


		std::list<LaurinIPNetworkClient>* getClients();

	private:

		u_int32_t _local_address;
		u_int32_t _subnet_mask;
		std::list<LaurinIPNetworkClient> _clients;

		LaurinIPRange* _range;


};

#endif
